#ifndef WF_DRAWLINERECTANGLE_H
#define WF_DRAWLINERECTANGLE_H

#include "pf_previewactioninterface.h"
#include "pf_line.h"
#include "gui_export.h"

/**
 * This action class can handle user events to draw 
 * rectangles with two corners given.
 *
 */
class GUI_EXPORT WF_DrawLineRectangle : public PF_PreviewActionInterface {
	Q_OBJECT
public:
    /**
     * Action States.
     */
    enum Status {
        SetCorner1,      /**< Setting the 1st corner.  */
        SetCorner2       /**< Setting the 2nd corner. */
    };

public:
    WF_DrawLineRectangle(PF_Container& container,
                               PF_GraphicView& graphicView);
    ~WF_DrawLineRectangle();

	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);

    void reset();

    virtual void init(int status=0);
    virtual void trigger();
    virtual void mouseMoveEvent(PF_MouseEvent* e);
    virtual void mouseReleaseEvent(PF_MouseEvent* e);
	void preparePreview();
	
	virtual void coordinateEvent(PF_CoordinateEvent* e);
    virtual void commandEvent(PF_CommandEvent* e);
	virtual PF_StringList getAvailableCommands();

    virtual void updateMouseButtonHints();
    virtual void updateMouseCursor();
    virtual void updateToolBar();

protected:
    /**
     * Line data for the 4 lines.
     */
    PF_LineAttribute data[4];
    /**
     * 1st corner.
     */
    PF_Vector corner1;
    /**
     * 2nd corner.
     */
    PF_Vector corner2;
};

#endif
